#VPATH	   = src include
SYSTEM     = x86-64_sles10_4.1
LIBFORMAT  = static_pic

#------------------------------------------------------------
#
# When you adapt this makefile to compile your CPLEX programs
# please copy this makefile and set CPLEXDIR and CONCERTDIR to
# the directories where CPLEX and CONCERT are installed.
#
#------------------------------------------------------------
#CPLEXDIR      = /home/lmin/ILOG/CPLEX_Studio_AcademicResearch122/cplex
#CONCERTDIR    = /home/lmin/ILOG/CPLEX_Studio_AcademicResearch122/concert

CPLEXDIR      = /opt/ILOG/CPLEX_Studio_AcademicResearch122/cplex
CONCERTDIR    = /opt/ILOG/CPLEX_Studio_AcademicResearch122/concert

#CPLEXDIR      = /filespace/groups/ece/shared/ILOG/CPLEX_Studio_AcademicResearch122/cplex
#CONCERTDIR    = /filespace/groups/ece/shared/ILOG/CPLEX_Studio_AcademicResearch122/concert
# ---------------------------------------------------------------------
# Compiler selection 
# ---------------------------------------------------------------------

CCC = g++

# ---------------------------------------------------------------------
# Compiler options 
# ---------------------------------------------------------------------

CCOPT = -m64 -fPIC -fexceptions -DNDEBUG -DIL_STD -g -Wall #-O

# ---------------------------------------------------------------------
# Link options and libraries
# ---------------------------------------------------------------------

CPLEXLIBDIR   = $(CPLEXDIR)/lib/$(SYSTEM)/$(LIBFORMAT)
CONCERTLIBDIR = $(CONCERTDIR)/lib/$(SYSTEM)/$(LIBFORMAT)
CONCERTINCDIR = $(CONCERTDIR)/include
CPLEXINCDIR   = $(CPLEXDIR)/include

CCDIR = ./src/
CCFLAGS = $(CCOPT) -I$(CPLEXINCDIR) -I$(CONCERTINCDIR) -I$(CCDIR) #-Iinclude/ 
CCLNFLAGS = -L$(CPLEXLIBDIR) -lilocplex -lcplex -L$(CONCERTLIBDIR) -lconcert -lm -lpthread

#------------------------------------------------------------
#  make all      : to compile the examples. 
#  make execute  : to compile and execute the examples.
#------------------------------------------------------------
all: sizer

sizer: extendedlibparser.o extendedtimingparser.o extendedspefparser.o parser_helper.o mip.o sizer.o
	$(CCC) $(CCFLAGS) extendedlibparser.o extendedtimingparser.o extendedspefparser.o parser_helper.o mip.o sizer.o -o sizer $(CCLNFLAGS)

sizer.o: sizer.cpp 
	$(CCC) -c $(CCFLAGS) sizer.cpp -o sizer.o

extendedlibparser.o: extendedlibparser.cpp 
	$(CCC) -c $(CCFLAGS) extendedlibparser.cpp -o extendedlibparser.o

extendedtimingparser.o: extendedtimingparser.cpp 
	$(CCC) -c $(CCFLAGS) extendedtimingparser.cpp -o extendedtimingparser.o

extendedspefparser.o: extendedspefparser.cpp 
	$(CCC) -c $(CCFLAGS) extendedspefparser.cpp -o extendedspefparser.o

parser_helper.o: parser_helper.cpp 
	$(CCC) -c $(CCFLAGS) parser_helper.cpp -o parser_helper.o

# ------------------------------------------------------------

clean :
	/bin/rm -rf *.o *~ *.class
	/bin/rm -rf $(C_EX) $(CPP_EX)
	/bin/rm -rf *.mps *.ord *.sos *.lp *.sav *.net *.msg *.log *.clp sizer

# ------------------------------------------------------------
#
# The examples
#
# Local Variables:
# mode: makefile
# End:

# VPATH		= src include
# CPPFLAGS	= -I include -g -Wall -lm
# CC	 	= g++ 
# All: sizer

# sizer: extendedlibparser.o extendedtimingparser.o extendedspefparser.o parser_helper.o sizer.o
# 	$(CC) $(CPPFLAGS) -o sizer extendedlibparser.o extendedtimingparser.o extendedspefparser.o parser_helper.o mip.o sizer.o -lpthread
# #sizer.o:circuitgraph.hpp optimization.hpp extendedverilogparser.hpp utility.hpp
# #validate.o: 
# #g++ -I include -g -Wall src/validate.cpp -o validate.o
# # extendedtimingparser.o:
# # extendedlibparser.o:
# # extendedsdcparser.o:
# # extendedspefparser.o:
# # parser_helper.o:

# clean:
# 	rm *.o sizer #core*
